/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-02-28
 * Time: 14:07
 */
public class Test {
    public static void main(String[] args) {
        RecentCounter recentCounter = new RecentCounter();
        System.out.println(recentCounter.ping(1));// requests = [1]，范围是 [-2999,1]，返回 1
        System.out.println(recentCounter.ping(100));// requests = [1, 100]，范围是 [-2900,100]，返回 2
        System.out.println(recentCounter.ping(3001));// requests = [1, 100, 3001]，范围是 [1,3001]，返回 3
        System.out.println(recentCounter.ping(3002));// requests = [1, 100, 3001, 3002]，范围是 [2,3002]，返回 3

    }

    public static void main2(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.push(1); // queue is: [1]
        myQueue.push(2); // queue is: [1, 2] (leftmost is front of the queue)
        System.out.println(myQueue.peek());//1
        System.out.println(myQueue.pop());//return 1, queue is [2]
        System.out.println(myQueue.empty());// return false
    }

    public static void main1(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        System.out.println(myStack.top()); //2
        System.out.println(myStack.pop()); //2
        System.out.println(myStack.empty()); //false
    }
}
